﻿<Page
    x:Class="DataBindingToAnotherControlValue.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="using:DataBindingToAnotherControlValue"
    mc:Ignorable="d">
	<Page.Resources>
		<local:GradeConverter x:Key="gradeConverter"/>
	</Page.Resources>
	<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
		<StackPanel>
			<Slider x:Name="Slider" VerticalAlignment="Stretch" Margin="30" Minimum="40" Maximum="100" Value="50"></Slider>
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
				<TextBlock Text="Grade Letter: " FontSize="32" />
				<TextBlock Foreground="White" FontSize="32" HorizontalAlignment="Left" 
						   Text="{Binding Path=Value, 
									ElementName=Slider, 
									Converter={StaticResource gradeConverter}}"></TextBlock>
				<TextBlock Margin="50,0" FontSize="32">
					<Run Text="("/>
					<Run Text="{Binding Path=Value, ElementName=Slider}" />
					<Run Text=")"/></TextBlock>
			</StackPanel>
		</StackPanel>
	</Grid>
</Page>
